fix(server): say up front that attach pauses the target (#654) - #660
Merged
Conversation
attach_to_process defaults stopOnEntry to true (thread verification, then
a pause request) and the docs said so, but the in-band schema an agent
actually reads said only "Stop on entry after attaching", and
create_debug_session — which forwards args.stopOnEntry into the same
inline attach — did not advertise the property at all. start_debugging
defaults the same flag to false, so an agent carrying that expectation
over froze the live server it had attached to, nine seconds after a
response that said state "running".
- tool-schemas: attach_to_process.stopOnEntry and a new
create_debug_session.stopOnEntry state the default and the live-service
case; start_debugging.dapLaunchArgs.stopOnEntry documents its opposite
default; the create_debug_session description says attaching pauses.
- attach-controller / session-tools: when the post-attach pause has not
landed by the time the tool answers, both message fields name it
("…; post-attach pause pending — the target stops when it next executes
code (pass stopOnEntry: false to attach without pausing)") next to the
existing pending:true. Observed pauses and stopOnEntry:false keep the
plain message. The attach default itself is unchanged.
- server.ts: the attach rejection for content addressing is
feature-specific — expectedContent callers already passed line, so
"use line addressing instead" read as a contradiction; it now says to
drop expectedContent and keep line.
- docs/skill: tool-reference (create_debug_session param, running+pending
example), agent guide, SKILL.md attach bullet, javascript README, and
the cpp/kubernetes notes that claimed the default was C/C++-specific.
- tests: 24 tool-list snapshots regenerated (four description hunks),
pending-message assertions on the attach controller and the inline
attach envelope, remedy wording pinned.
Verified live against `node --inspect` targets through a server built
from this branch: omitted stopOnEntry → paused (or pending when late),
stopOnEntry:false → running with the target still answering, and the
new set_breakpoint wording on an attach session.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DP1W22KJbkHZi4ueAtMFPF
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #654
Problem
attach_to_process(and the inline attach increate_debug_session) defaultsstopOnEntryto true: thread verification, then a DAP pause. The docs said so, but the in-band schema an agent actually reads said only "Stop on entry after attaching", andcreate_debug_sessiondid not advertisestopOnEntryat all even though its handler forwards it.start_debuggingdefaults the same flag to false, so an agent carrying that expectation over to a live server gotstate: "running"back and a frozen server nine seconds later, with nothing in the response saying a pause was coming.Changes
src/server/tool-schemas.ts):attach_to_process.stopOnEntryand a newcreate_debug_session.stopOnEntrystate the default and the live-service case;start_debugging.dapLaunchArgs.stopOnEntrydocuments its opposite default; thecreate_debug_sessiondescription says attaching pauses. 24 tool-list snapshots regenerated — exactly those four hunks.attach-controller.ts,session-tools.ts,error-messages.ts): when the post-attach pause has not landed by the time the tool answers, bothmessagefields end with; post-attach pause pending — the target stops when it next executes code (pass stopOnEntry: false to attach without pausing)next to the existingpending: true. Observed pauses andstopOnEntry: falsekeep the plain message.statestays"running"because that is true at that moment.set_breakpointattach rejection (src/server.ts): the remedy is feature-specific — anexpectedContentcaller already passedline, so "use line addressing instead" read as a contradiction; it now says to dropexpectedContentand keepline.statementkeeps "use line addressing instead".create_debug_sessionparam, arunning + pendingexample, launch/attach contrast), agent guide,skills/debugging/SKILL.mdattach bullet, javascript README, and the cpp/kubernetes notes that claimed the default was C/C++-specific.changelog.d/654.fixed.md.Deliberately unchanged: the attach default itself (item 3 of the issue). Seven e2e attach tests across python/js/java/dotnet/ruby pin "omitted
stopOnEntry⇒ paused"; flipping it is a cross-language behavior change that deserves its own issue.Verification
npm run typecheck,typecheck:tests(ratchet unchanged),lint,changelog:check; targeted unit tests (attach controller pending message, inline-attach envelope, rejection wording, snapshot fence).node --inspecttargets (the mcp-debugger HTTP server itself and an idle http server): omittedstopOnEntry→pausedwith the target frozen untilcontinue_execution;stopOnEntry: false→runningwith the target still answeringcurl;set_breakpoint {line, expectedContent}/{statement}→ the new wordings.MCP errorprefix on thrownMcpErrors).🤖 Generated with Claude Code
https://claude.ai/code/session_01DP1W22KJbkHZi4ueAtMFPF